home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-12 | 1.1 KB | 60 lines | [TEXT/CWIE] |
- // DebugMessage.cp
-
- #ifndef DebugMessage_h
- #include "DebugMessage.h"
- #endif
- #ifndef Numeral_h
- #include "Numeral.h"
- #endif
- #ifndef ConstData_h
- #include "ConstData.h"
- #endif
-
- uint8 DebugMessage::message[ maxuint8 + 2 ];
-
- DebugMessage::DebugMessage()
- {
- Length() = 0;
- message[ Length() + 1 ] = 0;
- }
-
- DebugMessage::DebugMessage( const char *string )
- {
- Length() = 0;
- message[ Length() + 1 ] = 0;
- *this << string;
- }
-
- DebugMessage& DebugMessage::operator<<( const char *string )
- {
- for ( uint32 i = 0; string[i] != 0 && Length() < maxuint8; i++ )
- message[ ++Length() ] = string[ i ];
- message[ Length() + 1 ] = 0;
- return *this;
- }
-
- DebugMessage& DebugMessage::operator<<( ConstData string )
- {
- for ( uint32 i = 0; i < string.Length() && Length() < maxuint8; i++ )
- message[ ++Length() ] = string[ i ];
- message[ Length() + 1 ] = 0;
- return *this;
- }
-
- DebugMessage& DebugMessage::operator<<( uint32 n )
- {
- return *this << Numeral( n );
- }
-
- DebugMessage& DebugMessage::operator<<( int32 n )
- {
- return *this << Numeral( n );
- }
-
- DebugMessage& DebugMessage::operator<<( void *p )
- {
- Numeral n( uint32(p), 16 );
- n.PadTo( 8 );
- return *this << n;
- }
-